/**
 * 👨‍💻 伟谭
 * 📅 2017/11/25
 */

#import "TWTypeListATableView.h"

#import "TWTypeListATableViewCell.h"

static NSString *const cellIdinter = @"idinter";

@implementation TWTypeListATableView

#pragma mark - Class method

#pragma mark - Life cycle

#pragma mark - Override
-(instancetype)init {
    
    if(self){
        
        self = [super init];
        self.bounces = NO;
        self.separatorStyle = UITableViewCellSeparatorStyleNone;
        
        NSIndexPath *ip=[NSIndexPath indexPathForRow:0 inSection:0];
        [self selectRowAtIndexPath:ip animated:YES scrollPosition:UITableViewScrollPositionBottom];
        
    }
    
    return self;
}

#pragma mark - Event response

#pragma mark - Protocol

#pragma mark <<#XXXDelegate#>>

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    TWTypeListATableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdinter];
    if(!cell){
        cell = [TWTypeListATableViewCell new];
    }
    if(indexPath.row == 0){
        cell.selected = YES;
    }
    return cell;
}

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
//    if(indexPath.row == 0){
//        [cell setSelected:YES animated:YES];
//        cell.selected = YES;
//    }
}



-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

}

#pragma mark - Public method

#pragma mark - Private method

#pragma mark - Getter & Setter

@end
